#include "junix.h"
using namespace std;

struct true_type {};
struct false_type {};

template <typename T>
struct is_POD : public false_type{ };

template<>
struct is_POD<char>:public false_type{ };

template<typename T>
void my_copy(T* a, T* c, true_type) {
	cout<<"POD copy\n";
	strcpy((char*)a,(char*)c);
}

template<typename T>
void my_copy(T* a, T* c, false_type) {
	cout<<"non-POD copy\n";
	do {
		*c=*a;
		c++;
		a++;
	} while (*a);
}

template<typename T>
void mycopy(T* a,T*b) {
	is_POD<T> is_pod;
	my_copy(a,b,is_pod);
}

int main(int argc, char **argv)
{
	char str[]="hello,world!\n";
	char str2[20]="\0";
	mycopy(str,str2);
	cout<<str2<<endl;
}


